Query selection method and system

ABSTRACT

A system and method for query selection are provided. The method may include acquiring a natural language sentence, pre-processing to obtain a standard node sequence, constructing a node tree based on the relationship between an index node and other nodes, generating a data query command based on the node tree, querying data using the data query command, and filtering the results. The standard node sequence may include at least an index node and a condition node. The node tree may be used to characterize the index-condition combination. The system may include an acquisition unit, a pre-processing unit, a node tree construction unit, a translation unit, and a querying and filtering unit.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation in part of U.S. patent applicationSer. No. 14/787,472 filed on Oct. 28, 2015 now U.S. Pat. No. 10,185,772,which is a National Stage Entry of International Application No.PCT/CN2014/080619 filed on Jun. 24, 2014, which claims priority ofChinese Application No. 201310155688.6 filed on Apr. 28, 2013, theentire contents of each of which are hereby incorporated by reference.

TECHNICAL FIELD

The present invention relates generally to process technology and, morespecifically, to a method and system for query selection.

BACKGROUND

When querying data from a database or other sources of data, a user istypically provided with several query options (or referred to as queryindexes or indexes) by systems currently in existence, and after a userchooses a certain index, the systems currently in existence collocaterestrictions according to the index, combine all the restrictions basedon a logic relationship of “and” or “or,” generate query instructions,query and filter data from the database, and display the filtered resultto the user. In such systems, the user may be unable to query and filterdata by providing a natural language sentence.

SUMMARY

Accordingly, in one embodiment of the present invention, a queryselection method and system is provided in order to solve theabove-identified problem.

To achieve the objective mentioned above, one embodiment of the presentinvention provides the following technical solutions:

A query selection method, at least based on a query selection system,including:

the query selection system obtaining a natural language sentenceprovided by a user;

the query selection system pre-processing the natural language sentenceprovided by the user, obtaining a standard node sequence, wherein thenode may include at least an index node and a condition node, whereinthe condition node may include at least one of a number node, a datenode, or a character string node;

the query selection system constructing a node tree according to arelationship between the index node and other nodes, wherein the nodetree may represent a combination of an index node and a condition node;

the query selection system generating a data query command according tothe node tree;

the query selection system querying data based on the data querycommand, filtering query results, and obtaining a filtered result; and

the query selection system displaying the filtered results.

A query selection system, including:

an acquisition unit configured to acquire a natural language sentenceprovided by a user;

a pre-processing unit configured to pre-process the natural languagesentence provided by the user, and obtain a standard node sequence,wherein the node may include at least an index node and a conditionnode, wherein the condition node may further include at least one of anumber node, a date node, or a character string node;

a node tree construction unit configured to construct a node treeaccording to a relationship between the index node and other nodes,wherein the node tree may be configured to represent an index-conditioncombination;

a translation unit configured to translate the node tree into a dataquery command;

a querying and filtering unit configured to query data based on the dataquery command, and filter query results to obtain a filtered result; and

a display unit configured to display the filtered result.

According to some other embodiments of the present disclosure, a queryselection method specifically for querying data from one or moredatabases is provided. The method may include obtaining a naturalsentence and generating a standard node sequence based on the naturalsequence. The standard node sequence may include multiple index nodesand at least one condition node. The multiple index nodes may correspondto indexes of the one or more database. The at least one condition nodemay include at least one of a number node, a date node, or a characterstring node. The method may also include constructing a node treeaccording to the standard node sequence. The node tree may be structuredto include the multiple index nodes, the at least one condition node, afirst relationship between a first index node of the multiple indexnodes and a second index node of the multiple index nodes, and a secondrelationship between at least one index node of the multiple index nodesand the at least one condition node. The method may further includegenerating a data query command according to the node tree, queryingdata using the data query command from the one or more databases toobtain a query result, and filtering the query result based on the nodetree to obtain a filtered result.

In some embodiments, the obtaining a natural sentence may include:receiving audio information inputted by a user via a voice input device;and performing a speech recognition on the audio information to obtainthe natural sentence.

In some embodiments, the obtaining a natural sentence may furtherinclude: determining a user status indicator by detecting, via anelectric sensor, a user status of the user when the user is inputtingthe audio information. The user status may relate to at least one of anactivity, a physical or mental state, an environment, or a location ofthe user when the user is inputting the audio information. The speechrecognition may be performed based on the user status indicator.

In some embodiments, the speech recognition may be performed based onhistorical activity information of the user.

In some embodiments, the generating a standard node sequence based onthe natural sequence may include: obtaining multiple words or phrases byperforming word segmentation on the natural sentence; obtaining a rawnode sequence corresponding to the natural sentence, wherein the rawnode sequence may include at least one node, each node of the at leastone node in the raw node sequence including a word or a phrase of themultiple words or phrases; determining that the raw node sequence isnon-standard by examining index key words or matching characteristics ofspecific phrasing; and converting the non-standard raw node sequence tothe standard node sequence.

In some embodiments, the converting the non-standard raw node sequenceto the standard node sequence may be based on a machine learningalgorithm.

In some embodiments, the method may further include identifying acategory of the user based on the identity information of the user,wherein the machine learning algorithm further takes the category of theuser as a part of its input.

In some embodiments, the converting the non-standard raw node sequenceto the standard node sequence is according to a conversion rule set.

In some embodiments, the method may further include: determining acategory of the user based on identity information of the user; andselecting, in response to the category of the user, an identity relatedrule from the conversion rule set. The non-standard raw node sequencemay be converted to the standard node sequence based at least in part onthe identity related rule.

In some embodiments, the method may further include displaying thefiltered result via an interface by: identifying a first indexcorresponding to an index node of the standard node sequence; anddisplaying, via the interface, first data of items of the filteredresult corresponding to the first index.

In some embodiments, the displaying the filtered result further mayinclude: selecting, from the indexes of the one or more databases, oneor more second indexes based on correlation indicators of the indexes ofthe one or more databases with respect to the first index, wherein eachof the correlation indicators indicates a correlation between acorresponding index of the indexes of the one or more databases and thefirst index; and displaying, via the interface, second data of items ofthe filtered result corresponding to the one or more second indexes,wherein the standard node sequence includes no node corresponding to theone or more second indexes.

In some embodiments, the method may further include: further displaying,via the interface, third data of items of the filtered resultcorresponding to a third index in response to an operation of a user;and updating the correlation indicator of the third index.

In some embodiments, the method may further include: further displaying,via an interface, fourth data of items of the filtered resultcorresponding to a fourth index in response to an operation of a user.

In some embodiments, the fourth index may not be included in the indexesof the one or more databases, and the method may also include:retrieving a computing mean for computing data of the fourth index basedat least in part on data of a fifth index included in the indexes of theone or more databases; and computing the fourth data based at least inpart on fifth data of items of the filtered result corresponding to thefifth index using the computing mean.

In some embodiments, the method may further include updating thestandard node sequence by: identifying a first update node included inan original version of the standard node sequence, the first update nodeindicating an update of the standard node sequence to be performed;identifying an index/condition node to be updated in the originalversion of the standard node according to nodes within a first distancefrom the first update node; identifying a second update node within asecond distance from the first update node, the second update nodeindicating how to update the index/condition node to be updated;updating the index/condition node to be updated according to the secondupdate node; and removing at least the first update node and the secondupdate node from the original version of the standard node.

In some embodiments, the method may further include: obtaining a thirdnatural sentence; generating a second standard node sequence based atleast in part on the third natural sentence; constructing a second nodetree based on the second standard node sequence; and filtering thefiltered result based on the second node tree to obtain a secondfiltered result.

In some embodiments, the generating a second standard node sequence mayinclude: constructing a preliminary standard node sequence based on thethird natural sentence; identifying one or more missing nodes of thepreliminary standard node sequence; identifying target nodes of thefirst standard node sequence corresponding to the one or more missingnodes of the second standard node sequence; and generating the secondstandard node sequence based on the target nodes of the first standardnode sequence and the preliminary standard node sequence.

In some embodiments, the method may further include: obtaining a fourthnatural sentence; generating a fourth standard node sequence based onthe fourth natural sentence, the fourth standard node tree including anoperation node and one or more object nodes, the operation nodecorresponding to a desired operation, and the one or more object nodesindicating one or more items of the filtered result; generating anoperation command according to the operation node and the one or moreobject nodes; and causing, according to the operation command, thedesired operation to be performed on the one or more items of the firstfiltered result.

According to some other embodiments of the present disclosure, a queryselection system specifically configured to query data from one or moredatabases is provided. The system may include a storage device storing aset of instructions, and at least one processor. When executing theinstructions, the at least one processor may cause the system to obtaina natural sentence and generate a standard node sequence based on thenatural sequence. The standard node sequence may include multiple indexnodes and at least one condition node. The multiple index nodes maycorrespond to indexes of the one or more database. The at least onecondition node may include at least one of a number node, a date node,or a character string node. The system may also be caused to construct anode tree according to the standard node sequence. The node tree may bestructured to include the multiple index nodes, the at least onecondition node, a first relationship between a first index node of themultiple index nodes and a second index node of the multiple indexnodes, and a second relationship between at least one index node of themultiple index nodes and the at least one condition node. The system mayfurther be caused to generate a data query command according to the nodetree, query data using the data query command from the one or moredatabases to obtain a query result, and filter the query result based onthe node tree to obtain a filtered result.

According to some other embodiments of the present disclosure, anon-transitory computer readable medium storing instructions compatiblefor querying data from one or more databases is provided. When executedby a processor, the instructions may cause the processor to executeoperations. The operations may include obtaining a natural sentence andgenerating a standard node sequence based on the natural sequence. Thestandard node sequence may include multiple index nodes and at least onecondition node. The multiple index nodes may correspond to indexes ofthe one or more database. The at least one condition node may include atleast one of a number node, a date node, or a character string node. Theoperations may also include constructing a node tree according to thestandard node sequence. The node tree may be structured to include themultiple index nodes, the at least one condition node, a firstrelationship between a first index node of the multiple index nodes anda second index node of the multiple index nodes, and a secondrelationship between at least one index node of the multiple index nodesand the at least one condition node. The operations may further includegenerating a data query command according to the node tree, queryingdata using the data query command from the one or more databases toobtain a query result; and filtering the query result based on the nodetree to obtain a filtered result.

According to the technical solutions described above, in one embodimentof the present invention, after a user provides a natural languagesentence, the query selection system may process the natural languagesentence automatically, construct a node tree representing anindex-condition combination, generate a data query command according tothe node tree, query results in the database, filter the results anddisplay the filtered result to the user, and thus implementing queryingand filtering data by providing a natural language sentence. Besides,the user may provide a natural language sentence without choosingindexes or collocating restrictions, and therefore the operations of theuser may be simplified and the user operation time may be reduced.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to illustrate the technical solutions in connection with theembodiments of the present invention or prior art more explicitly,drawings that may be used in the description of the embodiments or priorart are simply illustrated below. Obviously, drawings described beloware only some embodiments of the present invention. A person withordinary skill in the art, and without further inventive work, may applyother drawings to the provided drawings.

FIG. 1 is a schematic view of the structure of the query selectionsystem according to some embodiments of the present invention;

FIG. 2 is a flowchart of a process for the query selection according tosome embodiments of the present invention;

FIG. 3 is a flowchart of a process for the query selection according tosome embodiments of the present invention;

FIG. 4 is a flowchart of a process of the query selection according toSome embodiments of the present invention;

FIG. 5 is a schematic view of a node tree according to some embodimentsof the present invention;

FIG. 6 is a schematic view of a node tree according to some embodimentsof the present invention;

FIG. 7 is a flowchart of a process for query selection according to someembodiments of the present invention;

FIG. 8 is a flowchart of a process for query selection according to someembodiments of the present invention;

FIG. 9 is a flowchart of the query selection method according to Someembodiments of the present invention;

FIG. 10 is a flowchart of the query selection method according to someembodiments of the present invention;

FIG. 11 is a schematic view of the structure of an acquisition unitaccording to some embodiments of the present invention;

FIG. 12 is a flowchart illustrating an exemplary process for obtaining anatural language sentence according to some embodiments of the presentinvention;

FIG. 13 is a schematic view of the structure of a pre-processing unitaccording to some embodiments of the present invention;

FIG. 14 is a flowchart illustrating an exemplary process for obtaining astandard node sequence based on a natural language sentence according tosome embodiments of the present invention;

FIG. 15 is a schematic view of the structure of a display unit 1500according to some embodiments of the present invention;

FIG. 16 is a flowchart illustrating an exemplary process 1600 fordisplaying the filtered result according to some embodiments of thepresent invention;

FIG. 17 is a schematic view of the displayed first data according tosome embodiments of the present invention;

FIG. 18 is a schematic view of the concurrently displayed first data andsecond data according to some embodiments of the present invention;

FIG. 19 is a schematic view of the concurrently displayed first data,second data, and third data according to some embodiments of the presentinvention; and

FIG. 20 is a flowchart illustrating an exemplary process 2000 forhanding a natural language sentence including updating informationaccording to some embodiments of the present invention.

DETAILED DESCRIPTION

The technical solutions of the embodiments of the present invention willbe described clearly and completely in connection with the accompanyingdrawings. Obviously, the embodiments described herein are only part ofsome embodiments of the present invention and not all of them. All otherembodiments obtained by a person with ordinary skill in the art based onthe embodiments of the present invention without further inventive workare within the scope of protection of the present invention.

When querying data from a database or a data source, a user is typicallyprovided with several query options (or referred to as query indexes orindexes) by systems currently in existence, and after the user chooses acertain index, collocates restrictions according to the index, andcombines all the restrictions based on logic relationship of “and” or“or”, the system currently in existence may generate query instructions,query and filter data from the database, and display to the user.

For example, if a user wants to search for students whose math scoresand Chinese scores are both above 80, the user may need to choose atleast two indexes of “math score” and “Chinese score”, set tworestrictions of”>80, and combine the two restrictions based on an “and”logical relationship. The system may then generate a query command,query and filter data from the database or data sources, and display.

Therefore, the user may be unable to query and filter data by providinga natural language sentence using existing technologies found in theprior art.

Accordingly, embodiments of the present invention provide a queryselection process and system in order to solve the above problems.

Referring to FIG. 1, the query selection system mentioned above mayinclude at least an acquisition unit 1, a pre-processing unit 2, a nodetree construction unit 3, a translation unit 4, a querying and filteringunit 5, and a display unit 6.

Based on the query selection system mentioned above, referring to FIG.2, a process for query selection according to some embodiments of thepresent invention includes at least the following steps:

S1, the query selection system (the acquisition unit) acquiring anatural language sentence provided by a user;

A user may provide the natural language sentence by a handwriting input,a keyboard input, or a voice input. Therefore, the acquisition unitmentioned above may include a keyboard, a microphone (for voice input),a stylus, and a touch-screen (the stylus and the touch-screen may beconfigured for handwriting input), etc.

S2, the query selection system (the pre-processing unit) pre-processingthe natural language sentence provided by the user and obtaining astandard node sequence (considering there are other standard nodesequences mentioned later, the standard node sequence obtained in stepS2 may be referred to as a first standard node sequence).

The nodes mentioned above may include at least an index node and acondition node, and the condition node may include at least one of thefollowing: a number node, a date node, or a character string node.

S3, the query selection system (the node tree construction unit)constructing a node tree based on the relationship between the indexnode and other nodes, wherein the node tree may be configured torepresent an index-condition combination;

S4, the query selection system (the translation unit) generating a dataquery command according to the node tree;

S5, the query selection system (the querying and filtering unit)querying data based on the data query command, and filtering the queryresult to obtain a filtered result;

S6, the query selection system (display unit) displaying the filteredresults. Specifically, the display unit may be a display screen.

According to the technical solutions described above, in someembodiments of the present invention, after a user provides a naturallanguage sentence, the query selection system may automatically processthe natural language sentence, construct a node tree representing anindex-condition combination, generate a data query command according tothe node tree, query and filter data from the database, and display aresult to the user, thereby querying and filtering data based on anatural language sentence provided by the user. Besides, the user mayprovide a natural language sentence without choosing an index orcollocating a restriction, resulting in a simplification for useroperations and hence, a reduction of user operation time.

Steps S2 to S4 are illustrated in greater detail below.

First, the S2 step is illustrated. Referring to FIG. 3, in someembodiments of the present invention, the S2 step may include:

S21, performing word segmentation with respect to a natural languagesentence provided by the user and obtaining multiple words or phrases;

S22, constructing a node for each word or phrase, and obtaining raw nodesequences corresponding to the natural language sentence provided byuser;

The raw node sequence may include at least one node.

More specifically, nodes corresponding to each word or phrase may beconstructed by utilizing a configuration dictionary; the types of nodesmay include a question word node, an index node, a number node, a datenode, a logic word node, a character string node, etc., and a semanticnode sequence corresponding to the sentence provided by the user may beobtained.

Either the number node or the character string node may be a restrictionfor an index node. For example, in “the math score of Ming Li in roomfive, the 3rd grade,” “Ming Li” may be a character string node, whichmay be a restriction of the index node “name”; while in “math scoreabove 90,” “above 90” may be a number node as a restriction for theindex node “math score.”

When the number node and the date node are con figured, it may first berecognized that a phrase includes a number, it may then be determinedwhether this number is a date; if so, the number may be constructed as adate node; otherwise it may be constructed as a number node.

It shall be noted that the query options (namely query indexes) aparticular system (namely under certain scenarios) may provide may befixed. For example, in a student grade query system, the indexes it mayprovide including grade, class, subjects (such as math, Chinese,geography, history, biology, and so on), etc., may be fixed. Therefore,the index key words may be used to match the words and phrases obtainedfrom word segmentation, and thus to identify indexes included in thesentence provided by the user.

For example, using index key words such as math, Chinese, geography,history, biology, etc., from “subjects” index, to match the sentence“the students in room five, the 3rd grade whose math score is over 90points and Chinese score is over 80 points, the system may determinethat the sentence includes two indexes “math” and “Chinese.”

Similarly, the logic words may be fixed; a logic word dictionary may bepredetermined, which may include key logic words such as “as well as,”“and,” “moreover,” “meanwhile,” “with,” “or,” etc., and then the logickey words may be used to match the words and phrases obtained from wordsegmentation, and thus the system may determine whether there are logicrelationship nodes.

S23, converting the raw node sequence to a standard node sequence (whichmay be processed by the following node tree construction unit);

Because a user may provide an arbitrary natural language sentence, thecorresponding node sequence may be unstandardized. In the previousexample, “the math score of Ming Li in room five there is the phrase“Ming Li” without the word “name, where the corresponding node sequencemay include a character String node “Ming Li,” and may lack acorresponding index node “name.” Therefore, the index node “name” mayneed to be appended in order for a standard node sequence to begenerated as in “the math score of name Ming Li in room five, the 3rdgrade.”

More specifically, the node sequences corresponding to a naturallanguage sentence provided by a user may be converted to a standard nodesequence that may be processed by the node tree construction unitaccording to the configuration rules:

First, whether the phrasing of the raw node sequence is standard isdetermined by examining key words and matching the characteristics ofspecific phrasing, the detected non-standard phrasings are converted tosemantic node sequences corresponding to standard phrasings according tothe conversion rules set by the configuration files. The key words maybe expressed using regular expression.

For example, if a user inputs “it rains for 3 consecutive days”, theregular expression “for * consecutive days” may be used to match andconvert phrasing, converting “it rains for 3 consecutive days” tostandard phrasings “it rains today, it rained yesterday and it rainedthe day before yesterday.”

Meanwhile, “rain” is a character string node of the condition nodes, itmay correspond to the index node “weather, therefore, the index node“weather” needs to be appended. Finally, the standard phrasing isconverted as “the weather today is rain, the weather yesterday was rainand the weather the day before yesterday was rain.”

It should be noted that if the user uses voice input to provide asentence, the above step S2 may also include a step of speechrecognition to convert voice input into text and to obtain a textresult, thus converting voice into text.

After obtaining a standard node sequence, the following step S3 mayinclude constructing a node tree according to the relationship betweenthe index node and other nodes.

In some embodiments, the converting the non-standard raw node sequenceto the standard node sequence may be based on a machine learningalgorithm. The model for implementing the machine learning algorithm maytake the raw node sequence as at least part of its input, and generatethe standard node sequence as its output. The machine learning algorithmmay be based on decision tree, support vector machine (SVM), neuralnetwork (e.g., Convolutional Neural Network (CNN), Recurrent NeuralNetwork (RNN), residential network (ResNet), sequence to sequence(Seq2Seq) network), Bayesian network, genetic algorithm, or the like, ora combination thereof. The model used to implement the machine learningalgorithm may be trained using a training dataset. For example, thetraining dataset may include a plurality of raw node sequences as inputs(or be referred to as training inputs) of the model and correspondingstandard node sequences as supervisory outputs. The raw node sequencesmay be inputted into the model to generate a predicted output. Based onthe difference between the predicted output and the correspondingsupervisory output, parameters of the model may be adjusted using atraining algorithm (e.g., an algorithm based on backpropagation) toreduce such a difference. After the training is completed (e.g., aconvergence is met), the model may be adopted by the pre-processing unit2 for converting raw node sequences into standard node sequences.

In some embodiments, the whole operation S2 may be performed based on amodel of a machine learning algorithm. The model may take the naturallanguage sentence as at least part of its input, and generate acorresponding standard node sequence as its output. For example, thetraining dataset for training such a model may include a plurality ofnatural language sentence as training inputs of the model andcorresponding standard node sequences as supervisory outputs. After thetraining is completed, the model may be adopted by the pre-processingunit 2 for converting natural language sentences into standard nodesequences.

According to FIG. 4, Step S3 may further include the following:

S31, determining index-condition combinations, according to thepositional relationship between nodes.

For example, in “the students in class five, the 3rd grade whose mathscore is over 90 points and Chinese score is over 80 points,” “mathgrade” is an index node, “over 90 points” is a number node (conditionnode), and with respect to the positional relationship, “math grade” and“over 90 points” are next to each other. Given the positionalrelationship of the two, it may be determined that “over 90 points” is arestriction of the index node “math grade,” that is, “over 90 points” isa condition node of the index node “math grade.”

It should be noted that, “over 90 points” is not a precise value rangecomprehensible by a computer. Therefore, the number node “over 90points” needs to be processed, and converted to a number node “>90”. Onthe other hand, if a number node already includes a precise value range,for example, a user provides a sentence “room five, the 3rd grade, witha math grade >90,” the number node may not need to be processed.

More specifically, when being processed, words or phrases such as“over.” “larger and “higher may be converted into an symbolic expressionsuch as “>”; similarly, words or phrases such as “below,” “smaller,” and“lower” may be converted into “<”; words or phrases such as “no largerthan,” “smaller than or equal to,” “no more than,” and “no higher than”may be converted into “<”; words or phrases such as “no smaller than,”“larger than or equal to,” “no less than,” and “no lower than” may beconverted into “>.”

Similarly, if a date node does not contain a precise date rangecomprehensible by a computer, the date node may need to be converted.Otherwise, conversion is not needed. For example, “this year is not aprecise date range comprehensible by a computer, and if this year isyear 2013, it may need to be converted to a date node “2013.”

Correspondingly, a logic word node may also need to be converted. Forexample, logic word nodes “also,” “together with,” “as well as,” “in themeantime,” and “in addition,” etc., may be converted to “and” or “&”;and logic word nodes “either,” and “otherwise” may be converted to “or.”

An index-condition combination may be eventually achieved in the similarmanner.

S32, constructing a node tree, according to the index-conditioncombinations.

A node tree corresponding to “in year 2013, the students in room five,the 3rd grade whose math score is over 90 points and Chinese score isover 80 points” may refer to FIG. 5.

Additionally, it should be noted that every index node may have acorresponding condition node in a node tree. For example, “a stock withyear over year (YOY) growth rates over 50% for three consecutive years'may include three index-condition combinations:

1) YOY growth rate in the most recent year (assuming year 2013)>50%:

2) YOY growth rate in last year (year 2012)>50%;

3) YOY growth rate in the year before last year (year 2011)>50%.

Therefore, according to FIG. 6, a node tree representing “a stock withyear over year (YOY) growth rates over 50% for three consecutive years”may include three index nodes of “YOY growth rate,” and each of theindex nodes may correspond to a condition node.|

Correspondingly, step S4 as described above may include:

determining a data source corresponding to an index node in the nodetree; and

translating the index node and a relevant condition node into a querycommand that may be consistent with the format requirement of the datasource.|

The reason for the above steps may be that data corresponding todifferent indexes may be stored in different data sources or databasesand the supported format of the query command in various data sourcesmay be different. Therefore, different formats of query commands mayneed to be translated based on the data sources.|

Although the format query commands may be different, querying based onindex-condition combinations may be applicable in every data sources.The present invention may utilize this characteristics and configure acommand translation program for each data source based on its specificquery command format. The translation program may be queried based onthe index nodes and the condition nodes. Additionally, in an embodimentof the present invention, the sematic comprehension of sentence providedby a user and the acquisition of final data may be separated processes.

Correspondingly, filtering of the query results in Step S5 describedabove may include:

Combining and/or filtering a query result, according to the relationshipbetween index nodes in the node tree.

Specifically, after obtaining query results, the results may be combinedand filtered according to the logical relationship between indexes, andthose satisfying all the combinations of index nodes and condition nodesmay be reserved.

As an example of filtering, as demonstrated in the node tree in FIG. 6and described above, the node tree illustrated in FIG. 6 representing “astock with year over year (YOY) growth rates over 50% for threeconsecutive years” may include three index nodes of “YOY growth rate.”and each of the index nodes may correspond to a condition node.

According to the query command, three types of query results may beobtained: the first type, stocks with YOY growth rate in the most recentyear (assuming year 2013)>50%:

the second type, stocks with YOY growth rate in last year (year2012)>50%:

the third type, stocks with YOY growth rate in the year before last year(year 2011)>50%.

According to the node tree in FIG. 6, the three index nodes may beconnected by an “and” logic relationship, and based on thisrelationship, three types of query results mentioned above may becombined and filtered to generate stocks simultaneously satisfying YOYgrowth rate in 2013>50%, YOY growth rate in 2012>50%, and YOY growthrate in 2011>50%.

Moreover, it should be noted that, in the example of “a stock with yearover year (YOY) growth rates over 50% for three consecutive years, thecorresponding node tree may include three index nodes “YOY growth rate.”when generating query commands, three query commands may be generatedcorresponding to the three index nodes, and the results may then begenerated and filtered. Alternatively, a single query command may begenerated to search for data that satisfies the conditions in all threeindexes. In this case, it may be unnecessary to perform data filteringon query results.

With respect to combination, it mainly refers to the situation thatindexes correspond to different data sources, and the query results maybe combined after being obtained from a plurality of data sources.

Referring to FIG. 7, other embodiments of the present invention, afterstep S6, may further include following steps:

S7, the query selection system displaying index condition combination.

Considering that a user may change indexes for a plurality of variousreasons, in other embodiments of the present invention, the methoddescribed above may also include following steps:

query selection system obtains condition changing command provided by auser; and

after obtaining a condition changing command, the system may changeconditions and regenerate data query command.

Correspondingly, the query selection system may include acommand-changing unit to obtain condition changing command provided by auser to change conditions accordingly and regenerate data query command.

Specifically, condition changing may further include conditionappending, condition amending, and condition deleting.

With respect to condition appending, a user may use a method similar tothe known art to choose the indexes that need to be appended andconfigure restrictions corresponding to those indexes. The user may alsoappend natural language conditions.

A button or icon may be set up so that command changing unit may beactivated when the user click it.

More specifically, referring to FIG. 8, if a user chooses to appendconditions in natural language, then the natural language sentenceappended by the user may be obtained (S10) (similar to S1), the appendednatural language sentence may then be pre-processed to obtain a secondstandard node sequence (S11)(similar to S2), the second standard nodesequence may be combined with the first standard node sequence togenerate a new first standard node sequence, the query command may beregenerated (S3) and querying and filtering in step S4 may be proceededto, depending on the query command.

However, if a user wishes to change only the conditions corresponding tosome indexes, or delete only some conditions or indexes, thecorresponding nodes of the first standard node sequence may be changedor deleted directly (S13) and step S3 may be further proceeded to.

For a specific implementation, after step S7, the query selection systemmay provide buttons “condition appending,” “condition changing,” and“condition deleting simultaneously to facilitate user's operations.

Besides, it should be noted that step S7 described above may beimplemented before S3 (shown in FIG. 9), and the time a user chooses tochange a condition may also be before the implementation of S3.

Else, referring to FIG. 10, after step S2, the following steps may beincluded:

S14, displaying the first standard node sequence so that the user mayacquire the system's “comprehension” of the index-condition combination;

For example, if a user inputs “the math score of Ming Li in class five,the 3rd grade,” then it may be converted to a first standard nodesequence “Grade 3rd Class Five Name Ming Li Subject math score” anddisplayed.

S15, determining whether the user confirms the correctness of the indexcondition.

A confirm button may be provided for a user. If the user confirms thecorrectness, S3 may be performed.

If the user confirms the incorrectness in index condition, then acondition changing command may be provided and condition appending,condition amending or condition deleting may be performed, which is notfurther discussed here.

For a specific implementation, after performing step S14, the queryselection system may provide buttons “confirm,” “condition appending,”“condition amending,” and “condition deleting” to facilitate user'soperations.

The implementation process of the present invention may be describedbelow via an example of “stocks with net profit increasing at over 50%for 3 consecutive years.”

Step (1), a user may provide a natural language sentence “stocks withnet profit increasing at over 50% for 3 consecutive years.”

Step (2), a raw node sequence “stocks|with net profit|increasing|at over50%|for 3 consecutive years.” may be obtained, where “|” is used toseparate nodes.

In this step, it can be made clear that stocks are to be searched. Thecharacteristics of “net profit” and “increasing” provided by theconfiguration files may be used to convert the nonstandard phrasing inthe raw node sequence to a standard phrasing “stocks with year over year(YOY) growth over 50% for 3 consecutive years.”

Step (3), number node and time node may be analyzed.

In this embodiment, “over 50%” may be converted to “>50%, and “for 3consecutive years” may be converted to a specific time scope expandingfrom the most recent year to the previous two years.

Step (4), a node tree may be constructed.

First, the number node “>50%” may be bound to the index “net profit(with year over year (YOY) growth) as a filtering condition and the timenode “for 3 consecutive years” may be bound to it as a time parameter;

Because the characteristic of the time parameter bound to “net profit(with year over year (YOY) growth) is annual, “3 consecutive years' maybe divided into three annual time nodes “the most recent year,” “lastyear” and “the year before last year,” and other nodes may be copied,finally a node tree representing three index conditions may be obtained(referring to FIG. 6).

It should be noted that when this stock selection demand is processed bya traditional stock selection tool, the user may typically be asked tochoose the index “net profit (with year over year (YOY) growth)” threetimes separately, choose the year corresponding to each index and set arestriction “index over 50%” for each year, thus the operation may becomplicated. However, the embodiment of the present invention onlyrequires a user to provide a natural language sentence, whichsignificantly simplifies the user's operations.

Step (5), the index-condition combinations above may be translated to adata query command.

First, the data source corresponding to the index “net profit (with yearover year (YOY) growth)”, may be determined, 3 index-conditioncombinations described above may then be translated to a supported querycommand according to the data sources format requirement on the querycommand.

Step (6), the query demand may be executed, and condition “net profit(with year over year (YOY) growth)>50%” may be used to filter out stockswhich don't satisfy the condition.

Step (7), queried stocks and the corresponding net profit (with yearover year (YOY) growth) may be displayed on an interface, and theobtained index-condition combination may also be presented to a user tocheck and examine.

Step (8), a user may choose to change conditions (i.e. to input acondition changing command as described above), such as appending acondition “Zhejiang Province,” in order to obtain “stocks having netprofit increase over 50% for 3 consecutive years” within “ZhejiangProvince.” Alternatively, a user may change “>50%” in “net profit (withyear over year (YOY) growth) in the most recent year >50%” to “<30%,”and reselect the stocks.

If the user do not further change conditions, the process may normallyend.

It should be noted that the technical solutions provided by theembodiments of the present invention may be used in fields of searching,communication, industry, etc. A brief example in each field will bedescribed below:

In the field of searching, when a user provides a natural languagesentence on a website, the website server (namely query selectionsystem) may perform steps S1 to S4, and convert the natural languagesentence provided by the user to data query commands. The website servermay then use data query commands to query the results, then filter theresults (Step S5) and return and display filtered results on the clientside, thus completing a search.

In the field of communication, for example, when a user inputs “callMing Li,” the cellphone (namely the query selection system) may, afterperforming steps S1 and S2, convert natural language sentence providedby the user to a standard node sequence “call contact Ming Li”, where“contact” is an index node, and “Ming Li” is a character string node. Insteps S3, S4 and S5, data command may be generated, contacts in thecellphone may be queried, and the phone number of “Ming Li” may beacquired and displayed. Thereafter, the method described above mayfurther include giving a phone call (to “Ming Li’) according to thequery result of “Ming Li's” phone number.

In the field of industrial control (such as steelmaking), if a userinputs “maintain the temperature at 50 degree,” the PLC (namely thequery selection system) may, after performing steps S1 and S2, recognizean index node “temperature” and a number node “50 degree”. In steps S3,S4, S5 and S6, PLC may generate data command, query the currenttemperature of the steelmaking product line and display it (thesteelmaking product line may regularly uploads it current temperature toa database). The method described above may further include comparingthe current temperature of the steelmaking product line with “50degrees.” If the former value is lower than the latter one, thetemperature may be increased; otherwise, if the former value is higherthan the latter one, the temperature may be decreased.

Accordingly, a query selection system may be within the scope ofprotection of the present invention, referring again to FIG. 1, thissystem may at least include:

an acquisition unit 1, configured to acquire a natural language sentenceprovided by a user;

a pre-processing unit 2, configured to pre-process the natural languagesentence provided by the user, and obtain a first standard nodesequence, wherein the node may include at least an index node and acondition node, wherein the condition node may further include at leastone of a number node, a date node, or a character string node;

a node tree construction unit 3, configured to construct a node tree,according to the relationship between the index node and other nodes,wherein the node tree is configured to represent an index-conditioncombination;

a translation unit 4, configured to translate the node tree into a dataquery command;

a querying and filtering unit 5, configured to query data according tothe data query command, and filter query result to obtain a filteredresult; and

a display unit 6, configured to display the filtered result.

The display unit 6 may also be used to display index conditioncombinations.

For specific details, please refer to the descriptions in the previouspart of this disclosure and they are not further discussed here.

In other embodiments of the present invention, the query selectionsystem described above may also include a changing unit to obtaincondition changing command provided by a user and change conditionsaccordingly.

More specifically, the changing unit may further include conditionappending unit and condition amending/deleting unit.

When a user provides appended a natural language sentence, the conditionappending unit may obtain the appended natural language sentenceprovided by the user, pre-process them to obtain second standard nodesequences, combine the second standard node sequences with the firststandard node sequences, and then, instruct the node tree constructionunit 3 to regenerate a data query demand.

The condition amending/deleting unit may amend or delete thecorresponding nodes of the first standard node sequence according touser's operations of amending or deleting and then instruct the nodetree construction unit 3 to regenerate data query command.

For specific details, please refer to the descriptions in the previouspart of this disclosure and they are not further discussed here.

At last, it should be noted that the preprocess unit, the node treeconstruction unit, the translation unit, the filtering unit and commandchanging unit in this query selection system, may be hardware unit,electric circuit or logic unit. When these units are logic units, theirrespective functions may be completed by a processer.

FIG. 11 is a schematic view of the structure of an acquisition unit 1100according to some embodiments of the present invention. The acquisitionunit 1100 may be an example of the acquisition unit 1 as illustrated inFIG. 1 and may obtain a natural language sentence based on audioinformation (e.g., voice) inputted by a user. The acquisition unit 1100may include an audio information block 1110, a user status block 1120(optional), a speech recognition block 1130.

The audio information block 1110 may be configured to receive audioinformation inputted by a user via a voice input device. The audioinformation may be used for generating a natural language sentence fordata querying.

The user status block 1120 may be configured to determine a user statusindicator by detecting, via an electric sensor, a user status of theuser when the user is inputting the audio information.

The speech recognition block 1130 may be configured to perform a speechrecognition on the audio information received by the audio informationblock 1110 to obtain a natural language sentence. The speech recognitionmay be based on the user status indicator determined by the user statusblock 1120. The obtained natural language sentence may then be used togenerate a node tree for querying data via any one of the aforementionedprocesses.

In some embodiments, the user status block 1120 may be removed from theacquisition unit 1100, and the speech recognition block 1130 may performthe speech recognition without using the aforementioned user status.

Detailed descriptions of the above blocks of the acquisition unit 1100may be found elsewhere in the present invention (e.g., in connectionwith FIG. 12).

FIG. 12 is a flowchart illustrating an exemplary process 1200 forobtaining a natural language sentence according to some embodiments ofthe present invention. The process 1200 may be implemented by theacquisition unit 1100 as illustrated in FIG. 11 or an embodiment thereofto achieve S1 of any one of the aforementioned processes. In someembodiments, the process 1200 illustrated in FIG. 12 may be stored in astorage device in the form of instructions, and invoked and/or executedby one or more processors.

In 1210, the audio information block 1110 may receive audio informationinputted by a user via a voice input device (e.g., a microphone). Theaudio information may include a speech given by the user, which mayinclude a command for data querying or for other desired operations. Insome embodiments, the audio information block 1110 may preprocess thereceived audio information to reduce background noise and/or to enhancethe voice command spoken by the user.

In 1230, the speech recognition block 1130 may perform a speechrecognition on the audio information to obtain a natural languagesentence, which may then be used for data querying via any one of theprocesses described in the present invention. Any proper techniquerelated to speech recognition may be adopted by the speech recognitionblock 1130 for obtaining the natural language sentence. For example, thespeech recognition may be based on a hidden Markov model (HMM), adynamic time warping (DTW) model, a neural network model (e.g., arecurrent neural network (RNN) model, or the like, or a combinationthereof.

In some embodiments, the speech recognition model adopted by the speechrecognition block 1130 may include a feature extraction sub-model, anacoustic sub-model, and a language sub-model. The feature extractionsub-model may extract features from the audio information and provide aplurality of feature vectors. The acoustic sub-model may transform theplurality of feature vectors into a plurality of phonemes. The languagesub-model may transform the plurality of phonemes into a plurality ofwords in the form of one or more sentences (i.e., the natural languagesentence for data querying).

In practice, some words of a speech may be ambiguous due to factorsincluding, e.g., similar pronunciation (homonyms), accent of the user,or the like, or a combination thereof. Inaccurately recognized naturallanguage sentence may cause a wrongly conducted data querying, leadingto a waste of user's time and computation resources. To improve theaccuracy of the speech recognition, in some embodiments, the process1200 may further include an operation 1215 to enhance the speechrecognition. It is noted that the operation 1215 may be optional in theprocess 1200 and may be removed or be replaced by any other similarlypurposed operation(s) in some embodiments of the present invention.

In 1220, the user status block 1120 may determine a user statusindicator by detecting, via an electric sensor, a user status of theuser when the user is inputting the audio information. The “userstatus,” as used herein, may relate to any information describing astatus of the user when the user is inputting the audio information. Forexample, the user status may relate to at least one of a physicalcondition, a mental condition, an activity, an expression, the currentlocation, or an environment of the user, or the like, or a combinationthereof. The electric sensor may be any proper sensor for sensing thecorresponding user status, such as a camera, an electrode, a GlobalPosition System (GPS) sensor, a lidar, a sonar, an infrared radiation(IR) sensor, a medical sensor, or the like, or a combination thereof.The user status indicator may include one or more descriptors of theuser status detected by the electric sensor and may be subjected to theoperation 1230. Then in 1230, the speech recognition block 1130 mayperform the speech recognition based on the user status indicator.

For instance, a user may query data about nearby “flour/flower” shops.Normally, it is difficult to recognize the word is “flower” or “flour”solely based on the audio information. However, by taking the userstatus into consideration, the accuracy of the recognition may begreatly improved. Exemplary embodiments, which may be implementedseparately or in combination to give a solution of the above case, areprovided as following. These embodiments are only for demonstrationpurposes and not intended to be limiting.

Embodiment I

the user status block 1120 may detect a surrounding environment/locationof the user using a camera, a GPS sensor, and/or a lidar. If the userstatus block 1120 identify that the surrounding environment/location ofthe user is home/kitchen, there may be a great chance that the word is“flour.” If the surrounding environment is identified as street/club,there may be a great chance that the word is “flower.”

Embodiment II

the user status block 1120 may detect the expression or mood of the userusing a camera, an electrode, and/or an IR sensor. If the user isidentified as in a neutral mood or impatient, there may be a greatchance that the word is “flour.” If the user is identified as beingsmiling or happy, there may be a great chance that the word is “flower.”

Embodiment III

the user status block 1120 may detect the activity of the user using acamera and/or a lidar. If the user is identified to be doing housework(e.g., cooking), there may be a great chance that the word is “flour.”If the user is identified to be strolling or dining, there may be agreat chance that the word is “flower.”

The health status, gender, age, etc., (e.g., detected by a medicaldevice and/or a camera) of the user may also facilitate the speechrecognition.

In some embodiments, the user status block 1120 may use one or moremodels for identifying one or more aspects of the user statuses. Forexample, the one or more models may include a neural network basedmodel, a decision tree based model, a face recognition model, or thelike, or a combination thereof. Each of the one or more models may takedata collected by the corresponding electric sensor as its input andoutput a label for describing the corresponding aspect. For example, aconvolutional neural network (CNN) based model for identifying theexpression of the user may output a label, which is a code correspondingto the identified expression. The obtained label(s) may be used togenerate the user status indicator and then be transmitted to the speechrecognition block 1130 to facilitate the speech recognition. Forexample, when multiple labels are obtained, the user status block 1120may sequentially concatenate the multiple labels to form a combinedvector as the user status indicator.

In some embodiments, the speech recognition may be performed based onhistorical activity information of the user. The historical activityinformation may include information related to historical input of theuser, historical data querying conducted by the user, historicallydetected user status, (e.g., relating to location, expression, activityof the user), historically obtained user status indicators, or the like,or a combination thereof. The user status block 1120 may analyze thehistorical information of the user (e.g., using a classifier based on amachine learning algorithm such as a decision tree algorithm, a randomforests algorithm, a CNN algorithm, an RNN algorithm, a ResNetalgorithm) for determining the user status indicator of the user. Indifferent embodiments, the user status indicator may be determined basedon only the currently detected user status, based on only the historicalactivity information, or based on both the currently detected userstatus and historical activity information. Other factors may also beused for determining user status indicators.

Then in 1230, the speech recognition block 1130 may perform a speechrecognition on the audio information to obtain the natural languagesentence based on the user status indicator. In some embodiments, thelanguage sub-model of the speech recognition model utilized by thespeech recognition block 1130 for speech recognition may take the userstatus indicator as part of its input, and generate the natural sentenceas its output.

For instance, the user status indicator may relate to themood/expression of the user. To train such a language sub-model, eachpiece of text in the corpus for training may be associated with anindicator (or be referred to as a training indicator) indicating themood/expression associated with the piece of text. Such a trainingindicator and the user status indicator as the training input of thesub-model may share the same format. The training indicators may bemanually assigned to pieces of text in the corpus, or be automaticallyidentified using an analysis model based on the corresponding piece oftext and/or the context thereof.

The obtained natural language sentence may then be used to generate astandard node sequence (e.g., the first/second standard node sequence)via the operation S2 of any one of the aforementioned processes of thepresent disclosure.

In some embodiments, the audio information block 1110 may also acquireaudio information for another use. For example, a user identity unit(not shown) of the query selection system may identify the identity ofthe user based at least in part on the audio information and obtainidentity information thereby. Based on the identity information of theuser, the user identity unit may perform a next operation accordingly.For example, the user identity unit may cause the query selection systemto abandon the data querying process for an unauthorized user for safetyissues, and optionally warn the user about deny of permission. Asanother example, the user identity unit may cause the query selectionsystem to perform the data querying process using setting or rulesspecialized (or customized) for different users to facilitate the dataquerying process.

In some embodiments, the data generated by the electric sensor may alsobe used for identifying the identity of the user. For example, theaforementioned user identity unit may perform a face recognition on aface image of the user captured by a camera or an IR sensor (as theelectric sensor) when the user is inputting the audio information. Basedon the face recognition result, the user identity unit may perform anext operation (e.g., deny of permission for an unauthorized user)accordingly.

In some embodiment, the user identity unit may perform theidentification based on both the data generated by the electric sensorand the audio information to improve the accuracy of the identification.

In some embodiments, the user identity unit may perform theidentification using any other related technology. For example, the useridentification may be based on bio-information of the user such asfinger-print or iris information.

It is noted that the above descriptions of the process 1200 are only fordemonstration purposes, and not intended to be limiting. It isunderstandable that, after learning the major concept of the presentinvention, a person of ordinary skills in the art may alter the process1200 in an uncreative manner. For example, the operations above may beimplemented in an order different from that illustrated in FIG. 12. Oneor more optional operations may be added to the flowcharts. One or moreoperations may be split or be combined. For example, the operations 1110and 1120 may be performed concurrently or sequentially. As anotherexample, the operation 1120 may be split into a user status detectingstep (which may also be merged into the operation 1110) and a userstatus indicator generating step (which may also be merged into theoperation 1130). All such modifications are within the scope of thepresent invention.

FIG. 13 is a schematic view of the structure of a pre-processing unit1300 according to some embodiments of the present invention. Thepre-processing unit 1300 may be an example of the pre-processing unit 2as illustrated in FIG. 1 and may pre-process the natural languagesentence obtained via the operation S1 or the process 1200 to obtain astandard node sequence (e.g., the first/second standard node sequence).The pre-processing unit 1300 may include a word segmentation block 1310,a raw node sequence block 1320, a standard node sequence block 1330, anda rulebook block 1340.

The word segmentation block 1310 may be configured to perform wordsegmentation on the natural sentence and obtain multiple words orphrases.

The raw node sequence block 1320 may be configured to construct a nodefor each of the multiple words or phrases and obtain a raw nodesequence. The raw node sequence may include at least one node, each nodeof the at least one node in the raw node sequence including a word or aphrase of the multiple words or phrases.

The standard node sequence block 1330 may be configured to convert theraw node sequence to a standard node sequence in response to a detection(by the standard node sequence block 1330) that the raw node sequence isnon-standard. The standard node sequence block 1330 may convert thenon-standard raw node sequence to the standard node sequence accordingto a conversion rule set.

The rulebook block 1340 may be configured to retrieve rules from theaforementioned configuration file (or be referred to as a rulebook) forperforming the conversion of the non-standard raw node sequence. In someembodiments, the rulebook block 1340 may also selectively provide one ormore rules to the standard node sequence block 1330 as theaforementioned conversion rule set. For example, the rulebook block 1340may select one or more rules according to identity information of theuser as at least part of the conversion rule set. The identity of theuser may be determined via a user identity unit (not shown) of the queryselection system as illustrated in FIG. 1.

Detailed descriptions of the above blocks of the pre-processing unit1300 may be found elsewhere in the present invention (e.g., inconnection with FIG. 14).

FIG. 14 is a flowchart illustrating an exemplary process 1400 forobtaining a standard node sequence based on a natural language sentenceaccording to some embodiments of the present invention. The process 1400may be implemented by the pre-processing unit 1300 as illustrated inFIG. 13 or an embodiment thereof to achieve S2 of any one of theaforementioned processes. In some embodiments, the process 1400illustrated in FIG. 14 may be stored in a storage device in the form ofinstructions, and invoked and/or executed by one or more processors.

In 1410, the word segmentation block 1310 may perform word segmentationon the natural sentence and obtain multiple words or phrases.

In 1420, the raw node sequence block 1320 may construct a node for eachof the multiple words or phrases and obtain a raw node sequence.

The operations 1410 and 1420 may be the same as or similar to theoperations S21 and S22 as illustrated in FIG. 3, which are not repeatedherein.

In 1430, the standard node sequence block 1330 may determine whether theraw node sequence is standard by examining key words and matching thecharacteristics of specific phrasing (e.g., as described in connectionwith the step S23). In response to a detection that the raw nodesequence is standard, the standard node sequence block 1330 may outputthe raw node sequence as a standard node sequence, which may then besubjected to the step S3 of any one of the aforementioned processes. Inresponse to a determination that the raw node sequence is non-standard,the standard node sequence block 1330 may convert the raw node sequenceto a standard node sequence via the operation 1440 according toconversion rules provided by the rulebook block 1340. In someembodiments, the rulebook block 1340 may provide the conversion rulesbased on identity information of the user (e.g., identified by theaforementioned user identity unit) via the operations 1450 and 1460.

In 1450, the rulebook block 1340 (or the user identity unit) maydetermine a category (or label) of the user based on the user identityinformation obtained by the user identity unit. For example, therulebook block 1340 may search the user identity information in a lookuptable. Items of the lookup table may each represent an associationbetween a corresponding pre-registered user and his/her category.

The category of the user may belong to a plurality of preset categoriesaccording to the user identity information. The plurality of presetcategories may be used for grouping users according to practical needs.For example, the plurality of preset categories may include “authorizeduser”, “unauthorized”, “registered”, “unregistered”, “paid user”,“premium user”, “free user”, “high-risk user”, “low-risk user”, etc. Asanother example, the plurality of preset categories may relate to jobs,user levels, genders, ages, physical status, mental status, or the like,or a combination thereof.

In 1460, the rulebook block 1340 may select, according to the categoryof the user, one or more identity related rules as at least part of theconversion rule set, and provide the conversion rule set to the standardnode sequence block 1330. For example, each of the plurality of presetcategories may be associated one or more rules specialized for the classin the rulebook. The rulebook block 1340 may obtain the rule(s)associated with the category of the user from the rulebook as the one ormore identity related rules. In some embodiments, there may be one ormore common rule(s) shared by all the plurality of preset categories.The rulebook block 1340 may also retrieve the common rule(s) as theother part of the conversion rule set. Then in operation 1440, thestandard node sequence block 1330 may convert the raw node sequenceaccording to the conversion rule set provided by the rulebook block1340.

The one or more identity related rules may improve the efficiency forthe corresponding class of user to query data, or may provide extrasafety to the data to be requested. The one or more identity relatedrules may be preset by the system or customized by a corresponding user.Exemplary identity related rules may include, when one or morecorresponding conditions are satisfied: adding or removing indexes,proceeding or skipping the data querying, displaying information, hidingor masking at least a part of data querying result, or the like, or acombination thereof.

For example, a user may input a natural sentence “show me the studentswho failed the last math examination and their correspondenceinformation.” A raw node sequence may be generated including“students|failed|last|math examination|correspondence”. As the user doesnot provide any information regarding to the class or grade of thestudents, without considering a use's identity, the obtained standardnode sequence may include “Target|Student|MathScore|<60|TIME|20180105|Display|Correspondence”, wherein the nodes“Target”, “Students”, “Math Score”, “<60”, “TIME”, and “20180105” may beused for generating a corresponding node tree for querying data, and thenodes “Display”, “Correspondence” may be used for specifying the data tobe displayed. Consequently, the user may get a search result includingstudents failed to pass the math examination in all the classes, all thegrades and their correspondence information. If the user is only incharge of the class 4th, grade 3rd, and only want to querycorrespondence information about students of the class 4th, grade 3rd,the user may have to conduct the querying again with extra effort toprovide such information. If the user has no permission for thecorrespondence information but is authorized for the list of studentsfailed the math examination, with traditional solutions, the user mayeither improperly obtain the unauthorized information or be warned thatthe data querying will not be performed due to the lack of permission.

However, in embodiments of the present invention, the identityinformation of the user may be obtained in real-time. In the above case,the user may be identified as in a category “supervisor of the class4th, grade 3rd”. A rule (a system default rule or a rule set by theuser) associated with such a category may constrain the data queryingscope in the students of class 4th, grade 3rd when no informationregarding to class or grade is provided. Therefore, the standard nodesequence block 1330 may convert the raw node sequence into a standardnode sequence “Target|students|Class|4|Grade|3|MathScore|<60|TIME|20180105|Display|Correspondence”, and the user may obtainthe required information with higher efficiency and less effort. Asanother example, the user may be identified as in a category “assistantsupervisor of the class 4th, grade 3rd”. Besides the above rule, anotherrule associated with such a category may specify that the correspondenceinformation of the students is not permitted. Therefore, the standardnode sequence block 1330 may convert the raw node sequence into astandard node sequence including “Class|4|Grade|3|MathScore|<60|TIME|20180105”, and a data querying may be conductedaccordingly. Consequently, a list of students in the class 4th, grade3rd who failed the math examination may be displayed to the user, butthe unauthorized correspondence information may not be displayed (or bemasked). Optionally, the user may be warned that the requestedcorrespondence information is unauthorized, and the user may determinewhether to ask for such a permission according to the list provided.

As another example, a user may input a natural sentence “show me thestocks with net profit increasing at over 50% last year and is predictedto have a rise over 10% in the next month. A raw node sequence may begenerated including “stocks, with net profit increasing, over 50%, lastyear, predicted to have a rise, over 10%, next month”. Withoutconsidering the use's identity, the obtained standard node sequence mayinclude “Target|Stocks|YOY growth|>50%|Time|2018|Predictedgrowth|>10%|Time|201902.” However, the index “predicted growth” may onlybe accessible by a premium user. If the user is not a premium user, theuser may only be warned with insufficient rank and the required dataquerying may not be conducted at all. The user may have to input a voicecommand again to at least search for stocks with net profit increasingat over 50% last year.

However, in embodiments of the present invention, the user may beidentified as in a category “normal user”. A rule (a system default ruleor a rule set by the user) associated with such a category may include:when a premium-only index and one or more common indexes are specifiedby the user in a single command, ignoring the premium-only index. Then,the standard node sequence block 1330 may convert the raw node sequenceinto a standard node sequence “Target|Stocks|YOY growth|>50%|Time|2018”,and the user may at least obtain a list of stocks with YOY growth above50% in 2018. The user may then further filter the obtained list based onthe content of the list, and the data querying efficiency may beimproved.

The above examples are only for demonstration purposes and not intendedto be limiting. Similar concept may be adopted in other applicationscenarios without inventive modifications.

In some embodiments, the converting of the raw node sequence or naturallanguage sentence to the standard node sequence may be performed using amachine-learning algorithm as described before. The category of theuser, the user status indicator, the data detected by the electricsensor, and/or the historical information of the user as describedbefore may also be inputted into the model implementing themachine-learning algorithm as a part of its input, so that the accuracyof the converting result may be improved. Correspondingly, to train sucha model, the training database of the model may further include thecorresponding data as a part of the training input.

It is noted that the above descriptions of the process 1400 are only fordemonstration purposes, and not intended to be limiting. It isunderstandable that, after learning the major concept of the presentinvention, a person of ordinary skills in the art may alter the process1400 in an uncreative manner. For example, the operations above may beimplemented in an order different from that illustrated in FIG. 14. Oneor more optional operations may be added to the flowcharts. One or moreoperations may be split or be combined. For example, the operations 1450and 1460 may be performed concurrently with the operations 1410 to 1440.As another example, the operations 1450 and 1460 may be performed inresponse to the determination result of the operation 1430. All suchmodifications are within the scope of the present invention.

FIG. 15 is a schematic view of the structure of a display unit 1500according to some embodiments of the present invention. The display unit1500 may be an example of the display unit 6 as illustrated in FIG. 1and may display the filtered result obtained via the operation S5 of anyone of aforementioned data querying processes. The pre-processing unit1500 may include a first index block 1510, a second index 1520, a thirdindex block 1530, a correlation indicator updating block 1540(optional), and a data display block 1550.

The first index block 1510 may identify a first index corresponding toan index node of the standard node sequence.

The second index block 1520 may select, from indexes of one or moredatabases, one or more second indexes based on correlation indicators ofthe indexes of the one or more databases with respect to the firstindex.

The third index block 1530 may identify a third index in response to anoperation of a user.

The correlation indicator updating block 1540 may update the correlationindicator of the third index with respect to the first index.

In some embodiments, the correlation indicator updating block 1540 maybe removed from the display unit 1500.

The data display block 1550 may display data of items of the filteredresult obtained by the querying and filtering unit 5. For example, thedata display block 1550 may display data of the items corresponding tothe above first index, second index, and/or the third index.

Detailed descriptions of the above blocks of the pre-processing unit1300 may be found elsewhere in the present invention (e.g., inconnection with FIG. 14).

FIG. 16 is a flowchart illustrating an exemplary process 1600 fordisplaying the filtered result according to some embodiments of thepresent invention. The process 1600 may be implemented by the displayunit 1500 as illustrated in FIG. 15 or an embodiment thereof to achieveS6 of any one of the aforementioned processes. In some embodiments, theprocess 1600 illustrated in FIG. 16 may be stored in a storage device inthe form of instructions, and invoked and/or executed by one or moreprocessors.

In 1601, the first index block 1510 may identify a first indexcorresponding to an index node of the standard node sequence used forobtaining the filtered result to be displayed. Then in 1602, the datadisplay block 1550 may display, via the aforementioned interface, firstdata of items of the filtered result corresponding to the first index.The data display block 1550 may display the first data in any one ofproper graphic forms, such as a table and/or a chart.

The first index may be an index of one or more databases from which thedata is to be queried and be identified based on one or more index nodesincluded in the standard node sequence. In some embodiments, the firstindex block 1510 may use a lookup table to identify the first indexcorresponding to the index nodes. Items of the lookup table may eachrepresent an association between an index node and a corresponding indexof the one or more databases.

For example, when a user inputs a natural language sentence as “show methe top ten students in the last math examination.” The correspondingstandard node sequence may be “Target|Students|Mathranking|>10|TIME|20180105|”, which may include index nodes “Students”and “Math ranking.” The data querying may be conducted on a databaserecording scores of the students. The first index block 1510 mayidentify (e.g., using a lookup table) that the first index correspondingto the index node “Math ranking” may be the index “MATH RANKING” of thedatabase, and the index node “Students” may correspond to no index ofthe database. Then the data display block 1550 may display data (firstdata) under the first index “MATH RANKING” of items of the filteredresult. In some embodiments, the data display block 1550 may display thefirst data in the form as illustrated in FIG. 17.

FIG. 17 is a schematic view of the displayed first data according tosome embodiments of the present invention. The first data as well as anyother data to be displayed may be displayed in the form as a table. Thetable may include columns corresponding to indexes “NAME” and “MATHRANKING” of the database for displaying the corresponding data(including the first data), wherein the index “MATH RANKING” may be thefirst index identified in the operation 1601, and the index “NAME” maybe an index (or be referred to as a default index) of the database setto be displayed in default.

Refer back to FIG. 16. The operations 1601 and 1602 may be performed fordisplaying any data requested by the user. However, data of the indexes(except the default index) corresponding to no node of the standard nodesequence may not be displayed just by performing the operations 1601 and1602. In many situations, there may be one or more indexes (secondindexes) strongly correlated to the first index, and a user may oftenwant to obtain data corresponding to a second index although notexpressively specify the second index in the natural language sentencefor data querying. For example, in the above case, a user want to knowthe top ten students in the math examination may often want to knowtheir corresponding math scores. However, if the index “MATH SCORE” isnot set as a default index (which is the common case), the data displayblock 1550 may not display the data corresponding to “MATH SCORE” ifonly the operations 1601 and 1602 are performed, and the user may haveto make extra effort to “ask” the query selection system to display suchdata (e.g., by inputting another natural language sentence or any otherproper means), and the data querying efficiency may be reduced.

In embodiments of the present invention, operations 1603 to 1606 may beperformed to avoid such embarrassment.

In 1603, the second index block 1520 may select, from indexes of the oneor more databases, one or more second indexes based on correlationindicators of the indexes of the one or more databases with respect tothe first index. Then in 1604, the data display block 1550 may display,via the interface, second data of items of the filtered resultcorresponding to the one or more second indexes. The standard nodesequence may include no node corresponding to the one or more secondindexes.

Each of the correlation indicators may indicate the strength of thecorrelation between the corresponding index and the first index. Thecorrelation indicators may be preset by the query selection system orthe user. For example, the correlation indicators may be obtained byanalyzing the Big Data collected from a plurality of users by operatingone or more algorithms (e.g., via a Factorization Machines (FM)algorithm, a DeepFM algorithm). As another example, the correlationindicators may be obtained by priori knowledge such as one or morerules, functions, knowledge graphs.

In some embodiments, the correlation indicators may be updated accordingto the user's operations for displaying or hiding a specific index.

The second index block 1520 may use various approaches to select the oneor more second indexes based on the correlation indicators. In someembodiments, the second index block 1520 may perform a ranking on thecorrelation indicators, and select a predetermined number of indexesaccording to the ranking (e.g., top 1, top 2, top 3) as the one or moresecond indexes. In some embodiments, the second index block 1420 mayselect the indexes whose correlation indicator is above a predeterminedthreshold as the one or more second indexes.

For example, in the above case, the indexes of the database for dataquerying may include “NAME”, “MATH SCORE”, “MATH RANKING”, “PHYSICSSCORE”, “PHYSICS RANKING”, “ENGLISH SCORE”, “ENGLISH RANKING”, and“TOTAL RANKING”. The index “NAME” is a default index, and the index“MATH RANKING” is identified as the first index in the operation 1601.The correlation indicators of the above indexes with respect to thefirst index may be 1, 0.9, 1, 0.7, 0.5, 0.4, 0.3, and 0.8. The secondindex block 1520 may select the top 1 index or an index whosecorrelation indicator is equal to or more than 0.9 (the index “MATHSCORE”) as the second index to be displayed although an index nodecorresponding to the index “MATH SCORE” is not presented in the standardnode sequence for data querying.

In some embodiments, the second data and the first data may be displayedconcurrently on the interface (e.g., as illustrated in FIG. 18). FIG. 18is a schematic view of the concurrently displayed first data and seconddata according to some embodiments of the present invention. Asillustrated in FIG. 18, the table for displaying the first data mayfurther include a column corresponding to the identified second index“MATH SCORE” for displaying the corresponding second data, even when thecorresponding index node is not presented in the standard node sequencefor data querying.

In some embodiments, the second data and the first data may be displayedin a cycling manner. For example, the interface may display the firstdata, clear the first data, display the second data, clear the seconddata, display the first data, clear the first data, . . . , and so on.As another example, the interface may display the first part of thefirst & second data, the second part of the first & second data, . . . ,the last part of the first & second data, the first part of the first &second data, . . . , and so on.

In some embodiments, the second data and the first data may be displayedin a summary manner, that is, the second data and/or the first data maynot be displayed fully or displayed in detail on the interface at first.For example, the interface may only display a part (e.g., representativedata, earlier retrieved data) of the first data and/or the second data.As another example, the interface may display a chart representing asummary or analysis of the first data and/or the second data (e.g., thenumber of the items of the filtered result, the mean/median/mode ofnumbers included in the first/second data) without specific details. Theinterface may display the non-displayed data or details of thefirst/second data in response to an operation of the user. The operationmay include inputting a voice command, making a gesture or motion,operating a graphic element of the interface via an input device such asa mouse or a touchscreen, or the like, or a combination thereof.

In some embodiments, when multiple first indexes are identified in theoperation 1601, for each first index, the second index block 1520 mayidentify one or more second indexes. In some embodiments, all theidentified second indexes may be displayed via the interface.Alternatively, the second index block 1520 may select one or moreindexes from the identified second indexes for data displaying. Forexample, for each of the second indexes, the second index block 1520 maycompute a statistic metric (e.g., a mean, a sum, a median, a mode, etc.)of the correlation indicators of the second index with respect to all ofthe multiple first indexes. Then the second index block 1520 may selectthe one or more indexes based on the statistic metrics (e.g., via aranking). In some embodiments, a second index identified with respect toa first index may happen to be another first index identified in thesame standard node sequence. The computing of the statistic metric ofsuch a second index may be skipped.

It is noted that, the correlation indicator of an index A with respectto an index B may be or may not be the same as the correlation indicatorof the index B with respect to the index A. The correlation between theindex A and the index B may be asymmetric in some embodiments of thepresent invention. For example, the correlation indicator of the index“MATH RANKING” with respect to the index “MATH SCORE” may be 0.9, whilethe correlation indicator of the index “MATH SCORE” with respect to theindex “MATH RANKING” may be 0.8.

Refer back to FIG. 16. Although via the operations 1603 and 1604 a usermay obtain desired data without expressively specified it in the naturallanguage sentence, in many situations, the user may still want to obtainextra data corresponding to indexes failed to be selected as a secondindex, or hide data of an index selected as a second index against theuser's will. In embodiments of the present invention, the process 1600may also include optional operations 1605 and/or 1606 to further improvethe data querying efficiency and the satisfaction of the user.

In 1605, the data display unit 1550 may further display, via theinterface, third data of items of the filtered result corresponding to athird index (e.g., different from the first index and the secondindex(es) selected) in response to an operation of the user. The thirdindex may be specified by the operation of the user and be identified bythe third index block 1530. For example, the user may input anothernatural language sentence to specify the third index to be displayed.The natural language sentence may be processed by the pre-processingunit 2 or 1300 to generate a standard node sequence. The third indexblock 1530 may then identify a third index corresponding to an indexnode (or be referred to as a supplementary index node) of the thirdstandard node sequence. For example, in the above case the third naturallanguage sentence may be “Show the total ranking”. A standard index nodesequence may be obtained as “Display|total ranking”, including asupplementary index node “total ranking”. The third index “TOTALRANKING” may then be identified, and the corresponding third data maythen be displayed by the data display unit 1550.

It is noted that, the user may also specify the third index by operatinggraphic elements of the interface via an input device instead ofinputting the third natural language.

In some embodiments, the third data, the first data, and the second data(if any) may be displayed by the interface concurrently. (e.g., asillustrated in FIG. 19). FIG. 19 is a schematic view of the concurrentlydisplayed first data, second data, and third data according to someembodiments of the present invention. As illustrated in FIG. 19, thetable for displaying the first data may further include a columncorresponding to the third index “TOTAL RANKING” specified by the userfor displaying the corresponding third data. In some embodiments, thethird data, the first data, and the second data may be displayed by theinterface in the aforementioned cycling manner or summary manner.

In 1606, the correlation indicator updating block 1540 may update thecorrelation indicator of the third index with respect to the firstindex. Take the above case as an example, when the index “TOTAL RANKING”is specified by the user as the third index, the correlation indicatorupdating block 1540 may increase the correlation indicator of the thirdindex “TOTAL RANKING” with respect to the corresponding first index“MATH RANKING” from, e.g., 0.8, to, e.g., 0.81. If the correlationindicator of the index “TOTAL RANKING” with respect to the index “MATHRANKING” is in a increasing trend, eventually, the index “TOTAL RANKING”may be automatically selected as a second index by the query selectionsystem, and the user may not have to use extra operations to display theindex “TOTAL RANKING” when only the index “MATH RANKING” is specified inthe natural language sentence for data querying.

In some embodiments, optionally, the correlation indicator updatingblock 1540 may update (e.g., increase) the correlation indicators of thethird index with respect to all the indexes displayed by the interface(e.g., another first index, a second index). For example, in the abovecase, the correlation indicator updating block 1540 may update thecorrelation indicators of the index “TOTAL RANKING” with respect to thecorresponding first index “MATH RANKING” (e.g., increase by 0.1) and thesecond index “MATH SCORE” (e.g., increase by 0.1 or 0.05).

In some embodiments, the user may find that a second index isautomatically selected by the query selection system against his/herwill. The user may take an operation (e.g., inputting a natural languagesentence specifying the second index, operating a graphic element of theinterface) to hide the data of the corresponding second index. Thecorrelation indicator updating block 1540 may then update (e.g.,decrease) the correlation indicator of such a second index with respectto the corresponding first index. In some embodiments, the correlationindicator updating block 1540 may update (e.g., decrease) thecorrelation indicators of such a second index with respect to all theindexes displayed by the interface (e.g., another first index, a thirdindex). For example, in the above case, when the second index “MATHSCORE” is hide by the user, the correlation indicator updating block1540 may update the correlation indicators of the index “MATH SCORE”with respect to the corresponding first index “MATH RANKING” (e.g.,decrease by 0.1) and the third index “TOTAL RANKING” (e.g., decrease by0.1 or 0.05). If the correlation indicator of the index “MATH SCORE”with respect to the index “MATH RANKING” is in a decreasing trend,eventually, the index “MATH SCORE” may not be automatically selected asa second index by the query selection system.’

By updating the correlation indicators with respect to the user'soperation, the user may obtain desired information with improvedefficiency and less effort.

In some embodiments, the supplementary index may correspond to an index(or be referred to as a fourth index) not included in the one or moredatabases on which the data querying is performed. The data display unit1550 may retrieve a computing mean for computing data of the fourthindex based at least in part on data of one or more fifth indexesincluded in the indexes of the one or more databases. The computing meanmay be in the form of a function, a lookup table, a logical model, aphysical circuit, or the like, or a combination thereof.

For example, a fourth index “AVERAGE SCORE” may be a fourth indexspecified by a user of which the data is to be computed. The datadisplay unit 1550 may retrieve a function for computing the datacorresponding to the “AVERAGE SCORE.” For example, the function maycompute the mean of the math score, the physics score, and the Englishscore as the data corresponding to the index “AVERAGE SCORE”. Then thedata display unit 1550 may retrieve data of fifth indexes “MATH SCORE”,“PHYSICS SCORE”, and “ENGLISH SCORE” to compute the data of the fourthindex “AVERAGE SCORE” based on the retrieved data, and then display theobtained data.

In some embodiments, a fourth index may also be associated with one ormore correlation indicators with respect to different indexes of the oneor more databases, and may be automatically selected as a special“second index” of which the data may be computed in real-time.

The term “fourth index” and “third index” may be equivalent and may beused interchangeably. Data of the fourth index and the abovefirst/second/third data may be displayed in a concurrent manner, acycling manner, or a summary manner.

It is noted that the above descriptions of the process 1600 are only fordemonstration purposes, and not intended to be limiting. It isunderstandable that, after learning the major concept of the presentinvention, a person of ordinary skills in the art may alter the process1600 in an uncreative manner. For example, the operations above may beimplemented in an order different from that illustrated in FIG. 14. Oneor more optional operations may be added to the flowcharts. One or moreoperations may be split or be combined. All such modifications arewithin the scope of the present invention.

In some embodiments, a single natural language sentence inputted by auser may include a part representing a modification to be made toanother part of the natural language sentence, especially when the useris inputting the natural language sentence using a voice input mean. Forexample, the user may input a natural language sentence as “show me thestocks with net profit increasing at over 50% last year, wait, change itto 30%”. Without providing specific operations or conversion rulestowards such a situation, a raw node sequence may be generated including“stocks|with net profit increasing|over 50%|last year|30%”. The node 30%may correspond to no index node and a standard node sequence may not besuccessfully generated. The system may warn the user with an errorinformation and abort the data querying.

FIG. 20 is a flowchart illustrating an exemplary process 2000 forhanding a natural language sentence including updating informationaccording to some embodiments of the present invention. The process 2000may be implemented by the pre-processing unit 2 as illustrated in FIG. 1or an embodiment thereof and may be included in S2 of any one of theaforementioned processes. In some embodiments, the process 2000illustrated in FIG. 20 may be stored in a storage device in the form ofinstructions, and invoked and/or executed by one or more processors.

In the process 2000, words or phrases such as “change”, “modify”,“delete”, may also be converted into nodes. Such a node (first updatenode) may indicate an update of the information is to be performed.

In 2010, the pre-processing unit 2 may generate a raw node sequencebased on the natural language sentence. The operation 2010 may besimilar to the operations S21 and S22, while words or phrases indicatinga modification is to be made (e.g., “change”, “modify”, “delete”,“remove”) may also be converted into nodes. For example, in the abovecase, the generated raw node sequence may include “stocks|with netprofit increasing|over 50%|last year|change|it|to 30%”.

In 2020, the pre-processing unit 2 may generate an original version ofthe standard node sequence based on the raw node sequence. The operation2010 may be similar to the operations S23. For example, in the abovecase, the original version of the standard node sequence may be“Target|stocks|YOY growth|>50%|Time|2018|Change|Unknown|to 30%.”

In 2030, the pre-processing unit 2 may identify a first update nodeincluded in the original version of the standard node sequence. Thefirst update node may indicate an update of the standard node sequenceis to be performed. In the above case, the first update node may beidentified as the node “Change”.

In 2040, the pre-processing unit 2 may identify an index/condition nodeto be updated in the original version of the standard node according toone or more nodes within a first distance from the first update node.The term “distance” may represent the number of nodes from the firstupdate node. For example, in the node sequence “Target|stocks|YOYgrowth|>50%|Time|2018|Change|Unknown|to 30%”, the distance from the node“Change” to the node “to 30%” is 2, and the distance from the node“Change” to the node “Unknown” is 1.

The first distance may be a predetermined distance and may be set with aproper number such as 1, 2, 3. Taking the distance as 2 for example, thenodes having a distance within 2 from the first update node “Change” mayinclude “Unknown” and “to 30%”. The node “Unknown” may indicate the nodeto be updated is to be searched based on another node, and the node “to30%” may suggest the node to be updated is a condition node (or morespecifically a number node). Then the pre-processing unit 2 may searchfor all the number nodes in the standard node sequence before the firstupdate node. As there is only one number node (>50%) in the originalversion of the standard node sequence before the first update node, theonly number node “>50%” may be identified as the index to be updated.

In some embodiments, there may be more than one number node (or othertype of condition node) in the original version of the standard node.For example, for a natural language sentence “show me the stocks with aYOY growth over 50% for the last two years, no, change it to 30%”, acorresponding standard node sequence may be “Target|stocks|YOYgrowth|>50%|Time|2018|YOY growth|>50%|Time|2017|Change|Unknown|to 30%”.The pre-processing unit 2 may find two equal number nodes (“>50%”)accompany with the same index nodes (“YOY growth”) in the standard nodesequence. The pre-processing unit 2 may identify both the number nodesas the index to be updated. As another example, for a natural languagesentence “show me the stocks with a YOY growth over 50% for the year2018, and a predicted YOY growth over 10% for the year 2019, no, changeit to 30%”, a corresponding standard node sequence may be“Target|stocks|YOY growth|>50%|Time|2018|predicted YOYgrowth|>10%|Time|2019|Change|Unknown|to 30%”, the pre-processing unit 2may find two different number nodes (“>50%” and “>10%”) accompany withthe different index nodes (“YOY growth” and predicted “YOY growth”) inthe standard node sequence. The pre-processing unit 2 may identify thenearest number node (“>10%”) as the index to be updated. The sameidentification manner may also be adopted in the situation wheredifferent number nodes accompanying with the same index nodes.

In some embodiments, the user may specify the index to be updated in thenatural language sentence. For example, for a natural language sentence“show me the stocks with a YOY growth over 50% in 2018, no, change thestocks to funds”, a corresponding standard node sequence may be“Target|stocks|YOY growth|>50%|Time|2018|Change|stocks|to funds”. Thepre-processing unit 2 may first identity that the node “stocks” withinthe first distance represents the node to be updated (e.g., by countingthe serial number of the node starting from the first update node andthe total number of nodes within the first distance, by detecting a lackof predetermined words such as “to” or “by”), search for an index nodemost similar to the node “stocks”, and then designate the found node asthe node to be updated.

In 2050, the pre-processing unit 2 may identify a second update nodewithin a second distance from the first update node. The second updatenode may indicate how to update the index/condition node to be updated.The second distance may be the same as or different from the firstdistance. For example, the second distance may also be set as 2. In someembodiments, the pre-processing unit 2 may identify the nodes within thesecond distance including predetermined words such as “to” or “by” asthe second update nodes. In some embodiments, a first update node mayalso be a second update node. For example, a first update node “remove”or “delete” may also be regarded as a second update node.

In 2060, the pre-processing unit 2 may update the index/condition nodeto be updated according to the second update node. For example, for astandard node sequence “Target|stocks|YOYgrowth|>50%|Time|2018|Change|Unknown|to 30%”, the pre-processing unit 2may change the number node >50% into >30%. As another example, for astandard node sequence “Target|stocks|YOYgrowth|>50%|Time|2018|Increase|50%|by 10%”, the pre-processing unit 2may change the number node >50% into >60%. As a further example, for astandard node sequence “Target|stocks|YOYgrowth|>50%|Time|2018|predicted YOYgrowth|>10%|Time|2019|Remove|predicted YOY growth”, the pre-processingunit 2 may remove the index node “predicted YOY growth” and theaccompany nodes “>10%”, “Time”, and “2019”.

The pre-processing unit 2 may then remove at least the first update nodeand the second update node from the original version of the standardnode. In some embodiments, a node representing the node to be updatedmay also be removed as well. For example, for a standard node sequence“Target|stocks|YOY growth|>50%|Time|2018|Change|Unknown|to 30%”, afterchanging the node >50% into the node “>30%”, the nodes “Change”,“Unknown”, “to 30%” may be removed, and the obtained standard nodesequence may be “Target|stocks|YOY growth|>30%|Time|2018”, which may benormally used in the data querying.

It is noted that the above descriptions of the process 2000 are only fordemonstration purposes, and not intended to be limiting. It isunderstandable that, after learning the major concept of the presentinvention, a person of ordinary skills in the art may alter the process2000 in an uncreative manner. For example, the operations above may beimplemented in an order different from that illustrated in FIG. 20. Oneor more optional operations may be added to the flowcharts. One or moreoperations may be split or be combined. All such modifications arewithin the scope of the present invention.

In some embodiments, after S6, the following operations may be performedfor further filtering the filtered results obtained via the step S5. Theacquisition unit 1 may obtain a third natural language sentence (similarto the step S1 or an embodiment thereof). The pre-processing unit 2 maygenerate a second standard node sequence at least in part on the thirdnatural language sentence (similar to the step S2 or an embodimentthereof). The node tree construction unit 3 may construct a second nodetree based on the second standard node sequence (similar to the step S3or an embodiment thereof). Then the filtered result obtained via thestep S5 may be further filtered based on the second node tree to obtaina second filtered result (similar to the filtering the query results asin the step S5).

In some embodiments, the third natural language sentence may lack someinformation that has already been included in the first natural languagesentence. For example, the first natural language sentence may be “showme the students whose score is above 80 in the last math examination”,and have a corresponding standard node sequence “Target|Students|MathScore|>80|TIME|20180105.” The third natural language sentence may be“show me the ones over 90”. Solely based on the third natural languagesentence, only a number node “>90” may be obtained, which isinsufficient for constructing a node tree.

To solve the above problem, the pre-processing unit 2 may firstconstruct a preliminary standard node sequence based on the thirdnatural language. For example, in the above cases, the preliminarystandard node sequence may be “>90”.

Then the pre-processing unit 2 may identify one or more missing nodes ofthe preliminary standard node sequence. The pre-processing unit 2 mayuse one or more template for identifying the missing nodes. Thepre-processing unit 2 may determine the template to be used based on thetype and number of nodes in the preliminary standard node sequence. Insome embodiments, the pre-processing unit 2 may determine the templateto be used based further on a previously determined standard nodesequence. A template corresponding to a previous standard node sequencemay have a great chance to fit for the preliminary standard nodesequence.

For example, in the above case, a template used for identifying the oneor more missing nodes may be “Target|target node|First index node|Numbernode|Time|time node|”, and a target node, an index node, and a time nodeis identified as missing from the preliminary standard node sequence.

The pre-processing unit 2 may identify target nodes of the firststandard node sequence corresponding to the one or more missing nodes ofthe second standard node sequence and then generate the second standardnode sequence based on the target nodes of the first standard nodesequence and the preliminary standard node sequence. For example, in theabove case, the pre-processing unit 2 may search for a target node, anindex node, and a time node in the first standard node sequence“Target|Students|Math Score|>80|TIME|20180105,” and find a target node“students”, an index node “Math Score”, and a time node “20180105”.

The pre-processing unit 2 may then use the found target nodes and thepreliminary standard node sequence to generate the second standard nodesequence. For example, the pre-processing unit 2 may use nodes of thepreliminary standard node sequence and the found nodes to fill theblanks of the corresponding template, and the second standard nodesequence may be generated as a result.

In some embodiments, the query selection system may further providemeans for performing a desired operation on one or more items of thefiltered result. For example, the query selection system may obtain afourth natural language sentence input by a user and generate a fourthstandard node sequence based on the fourth natural language sentence(e.g., via the operations S1 and S2). The fourth standard node sequencemay include an operation node and one or more object nodes. Theoperation node may correspond to a desired operation to be performed,and the one or more object nodes may indicate one or more items of thefiltered result upon which the desired operation is to be performed. Thequery selection system may generate an operation command according tothe operation node and the one or more object nodes, and cause,according to the operation command, the desired operation to beperformed on the one or more items of the first filtered result.

The desired operation may be according to the application scenario ofthe querying selection system. For example, a filtered result obtainedaccording to a natural language sentence “show me the stocks with thenet profit increasing at over 50% for last three years” may include astock A and a stock B. The user may input a fourth natural languagesentence such as “buy 1,000 shares of the stock A”. A fourth standardnode sequence “Buy|1,000 shares|Stock A” may be generated accordingly,wherein the node “Buy” is the operation node, and the node “Stock A” isthe object node. The node “1,000 shares” may be a parameter nodespecifying how to perform the operation. The corresponding operationcommand may cause the querying selection system to buy 1,000 shares ofthe stock A.

In some embodiments, the user may not precisely give the correct name orfull name of the object of the operation. For example, in the abovecase, the user may just input “buy 1,000 shares of the A”.Correspondingly, the raw node sequence may be “Buy|1,000 shares|A”. Andthe object node may be determined as “A”, which is not a valid objectnode. To obtain the correct node “Stock A”, the querying selectionsystem may search the displayed data to find a corresponding node mostsimilar to the node “A”. The similarity may be determined based onvarious metrics. When the node “Stock A” is found as the node mostsimilar to the node “A”. The querying selection system may designate thenode “Stock A” as the object node. Optionally, the system may displaythe designated object node to double check with the user.

The embodiments in this disclosure are described progressively. That is,each embodiment describes the parts that are different from otherembodiments, and the same or similar parts may be applicable amongvarious embodiments.

The steps of methods or algorithm described in the disclosed embodimentsmay be implemented by hardware, software blocks executed by processers,or any combination thereof. The software blocks may be placed in randomaccess memory (RAM), read-only memory (ROM), electrically programmableROM, electrically erasable programmable ROM, register, hard disk,removable disk, CD-ROM or any other types of storage medium known in thetechnical field.

This description is intended to be illustrative for those skilled in theart to realize and implement present invention. Thus, many alternatives,modifications, and variations will be apparent to those skilled in theart. The features, structures, methods, and other characteristics of theexemplary embodiments described herein may be realized in otherembodiments without departing from the spirit and scope of the presentinvention. Therefore, the present invention is not limited to theembodiments described above but the broadest range which is consistentwith the disclosed method and the inventive characteristics in presentinvention.

What is claimed is:
 1. A query selection method specifically forquerying data from one or more databases, implemented on a hardwarewhich has at least one processor and a storage device, comprising:obtaining, by the at least one processor, a natural sentence;generating, by the at least one processor, a standard node sequencebased on the natural sentence, the standard node sequence includingmultiple index nodes and at least one condition node, wherein themultiple index nodes correspond to indexes of the one or more database,the at least one condition node including at least one of a number node,a date node, or a character string node; constructing, by the at leastone processor, a node tree according to the standard node sequence,wherein the node tree is structured to include the multiple index nodes,the at least one condition node, a first relationship between a firstindex node of the multiple index nodes and a second index node of themultiple index nodes, and a second relationship between at least oneindex node of the multiple index nodes and the at least one conditionnode; generating, by the at least one processor, a data query commandaccording to the node tree; querying, by the at least one processor,data using the data query command from the one or more databases toobtain a query result; and filtering the query result based on the nodetree to obtain a filtered result.
 2. The method of claim 1, wherein theobtaining a natural sentence comprises: receiving audio informationinputted by a user via a voice input device; and performing a speechrecognition on the audio information to obtain the natural sentence. 3.The method of claim 2, wherein the obtaining a natural sentence furthercomprises: determining a user status indicator by detecting, via anelectric sensor, a user status of the user when the user is inputtingthe audio information, wherein: the user status relates to at least oneof an activity, a physical or mental state, an environment, or alocation of the user when the user is inputting the audio information;and the speech recognition is performed based on the user statusindicator.
 4. The method of claim 2, wherein the speech recognition isperformed based on historical activity information of the user.
 5. Themethod of claim 1, wherein the generating a standard node sequence basedon the natural sentence comprises: obtaining, by the at least oneprocessor, multiple words or phrases by performing word segmentation onthe natural sentence; obtaining, by the at least one processor, a rawnode sequence corresponding to the natural sentence, the raw nodesequence including at least one node, each node of the at least one nodein the raw node sequence including a word or a phrase of the multiplewords or phrases; determining, by the at least one processor, that theraw node sequence is non-standard by examining index key words ormatching characteristics of specific phrasing; and converting, by the atleast one processor, the non-standard raw node sequence to the standardnode sequence.
 6. The method of claim 5, wherein the converting thenon-standard raw node sequence to the standard node sequence is based ona machine learning algorithm.
 7. The method of claim 6, furthercomprising: identifying a category of the user based on the identityinformation of the user, wherein the machine learning algorithm furthertakes the category of the user as a part of its input.
 8. The method ofclaim 5, wherein the converting the non-standard raw node sequence tothe standard node sequence is according to a conversion rule set.
 9. Themethod of claim 8, further comprising: determining a category of theuser based on identity information of the user; and selecting, inresponse to the category of the user, an identity related rule from theconversion rule set, wherein the non-standard raw node sequence isconverted to the standard node sequence based at least in part on theidentity related rule.
 10. The method of claim 1, further comprisingdisplaying the filtered result via an interface by: identifying a firstindex corresponding to an index node of the standard node sequence; anddisplaying, via the interface, first data of items of the filteredresult corresponding to the first index.
 11. The method of claim 10,wherein the displaying the filtered result further comprises: selecting,from the indexes of the one or more databases, one or more secondindexes based on correlation indicators of the indexes of the one ormore databases with respect to the first index, wherein each of thecorrelation indicators indicates a correlation between a correspondingindex of the indexes of the one or more databases and the first index;and displaying, via the interface, second data of items of the filteredresult corresponding to the one or more second indexes, wherein thestandard node sequence includes no node corresponding to the one or moresecond indexes.
 12. The method of claim 11, further comprising: furtherdisplaying, via the interface, third data of items of the filteredresult corresponding to a third index in response to an operation of auser; and updating the correlation indicator of the third index.
 13. Themethod of claim 1, further comprising: further displaying, via aninterface, fourth data of items of the filtered result corresponding toa fourth index in response to an operation of a user.
 14. The method ofclaim 13, wherein the fourth index is not included in the indexes of theone or more databases, and the method further comprises: retrieving acomputing mean for computing data of the fourth index based at least inpart on data of a fifth index included in the indexes of the one or moredatabases; and computing the fourth data based at least in part on fifthdata of items of the filtered result corresponding to the fifth indexusing the computing mean.
 15. The method of claim 1, further comprisingupdating the standard node sequence by: identifying a first update nodeincluded in an original version of the standard node sequence, the firstupdate node indicating an update of the standard node sequence to beperformed; identifying an index/condition node to be updated in theoriginal version of the standard node according to nodes within a firstdistance from the first update node; identifying a second update nodewithin a second distance from the first update node, the second updatenode indicating how to update the index/condition node to be updated;updating the index/condition node to be updated according to the secondupdate node; and removing at least the first update node and the secondupdate node from the original version of the standard node.
 16. Themethod of claim 1, further comprising: obtaining a third naturalsentence; generating a second standard node sequence based at least inpart on the third natural sentence; constructing a second node treebased on the second standard node sequence; and filtering the filteredresult based on the second node tree to obtain a second filtered result.17. The method of claim 16, the generating a second standard nodesequence comprising: constructing a preliminary standard node sequencebased on the third natural sentence; identifying one or more missingnodes of the preliminary standard node sequence; identifying targetnodes of the first standard node sequence corresponding to the one ormore missing nodes of the second standard node sequence; and generatingthe second standard node sequence based on the target nodes of the firststandard node sequence and the preliminary standard node sequence. 18.The method of claim 1, further comprising: obtaining a fourth naturalsentence; generating a fourth standard node sequence based on the fourthnatural sentence, the fourth standard node tree including an operationnode and one or more object nodes, the operation node corresponding to adesired operation, and the one or more object nodes indicating one ormore items of the filtered result; generating an operation commandaccording to the operation node and the one or more object nodes; andcausing, according to the operation command, the desired operation to beperformed on the one or more items of the first filtered result.
 19. Aquery selection system specifically configured to query data from one ormore databases, including a storage device storing a set ofinstructions, and at least one processor when executing the instructionscausing the system to: obtain a natural sentence; generate a standardnode sequence based on the natural sentence, the standard node sequenceincluding multiple index nodes and at least one condition node, whereinthe multiple index nodes correspond to indexes of the one or moredatabase, the at least one condition node including at least one of anumber node, a date node, or a character string node; construct a nodetree according to the standard node sequence, wherein the node tree isstructured to include the multiple index nodes, the at least onecondition node, a first relationship between a first index node of themultiple index nodes and a second index node of the multiple indexnodes, and a second relationship between at least one index node of themultiple index nodes and the at least one condition node; generate adata query command according to the node tree; query data using the dataquery command from the one or more databases to obtain a query result;and filter the query result based on the node tree to obtain a filteredresult.
 20. A non-transitory computer readable medium, storinginstructions compatible for querying data from one or more databases,wherein when executed by a processor, the instructions cause theprocessor to execute operations comprising: obtaining a naturalsentence; generating a standard node sequence based on the naturalsentence, the standard node sequence including multiple index nodes andat least one condition node, wherein the multiple index nodes correspondto indexes of the one or more database, the at least one condition nodeincluding at least one of a number node, a date node, or a characterstring node; constructing a node tree according to the standard nodesequence, wherein the node tree is structured to include the multipleindex nodes, the at least one condition node, a first relationshipbetween a first index node of the multiple index nodes and a secondindex node of the multiple index nodes, and a second relationshipbetween at least one index node of the multiple index nodes and the atleast one condition node; generating a data query command according tothe node tree; querying data using the data query command from the oneor more databases to obtain a query result; and filtering the queryresult based on the node tree to obtain a filtered result.